package com.samsung.app;

import android.content.Context;
import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import java.util.Iterator;
import java.util.List;

public class WifiUtils
{
  private static final String TAG = "INRY";

  public static String intToIp(int paramInt)
  {
    return (paramInt & 0xFF) + "." + (0xFF & paramInt >> 8) + "." + (0xFF & paramInt >> 16) + "." + (0xFF & paramInt >> 24);
  }

  public static void removeCameraConfigration(Context paramContext, boolean paramBoolean)
  {
    Logger.d("INRY", " removeCameraConfigration ");

    if (paramContext != null){
        WifiManager localWifiManager = (WifiManager)paramContext.getSystemService("wifi");
      List<WifiConfiguration> localList = localWifiManager.getConfiguredNetworks();
      WifiInfo localWifiInfo = localWifiManager.getConnectionInfo();
      
      if (localList != null){
	        	for(WifiConfiguration localWifiConfiguration : localList){
			      if ((!Utils.supportDSCPrefix(localWifiConfiguration.SSID)) || ((localWifiInfo.getNetworkId() == localWifiConfiguration.networkId) && (!paramBoolean))){
			    	  boolean bool = localWifiManager.removeNetwork(localWifiConfiguration.networkId);
			    	  Logger.d("INRY", "remove config>> wc SSID=" + localWifiConfiguration.SSID + ", wc.status=" + localWifiConfiguration.status + ", wc.networkId=" + localWifiConfiguration.networkId + "result=" + bool);
			      	}
	        }
      }
    }
  }
}
